import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "vant/lib/index.css";
import "@/styles/index.less";
import "@/icons/index.ts"; // svg
import SvgIcon from "@/components/SvgIcon.vue";
const app = createApp(App);

const toPath = (path: string) => {
  router.push(path);
};
const avatarVer = (url: string) => {
  return url || require("@/assets/avatar.png");
};
const sexShow = (sex: number) => {
  return sex == 0 ? "男" : sex == 1 ? "女" : "";
};

// 高度-vant的导航栏高度-vant的tabbar高度
app.provide("routerViewHeight", window.innerHeight - 46 - 50);
app.provide("toPath", toPath);
app.provide("avatarVer", avatarVer);
app.provide("sexShow", sexShow);
app.use(store).use(router).component("SvgIcon", SvgIcon).mount("#app");
